package com.practice.springboot_01_zwj.mapper;

import com.github.pagehelper.PageInfo;
import com.practice.springboot_01_zwj.entity.CloudNetwork;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


@Mapper
public interface CloudNetworkMapper {

    List<CloudNetwork> selectByCityCode(
            @Param("cityCode") String cityCode,
            @Param("providerType") String providerType);
//政务外网客户清单增删改查接口
    List<CloudNetwork> selectByCityCodeAndCustomerType(
            @Param("cityCode") String cityCode,
            @Param("customerType") String customerType,
            @Param("districtName") String districtName,
            @Param("customerName") String customerName);
    int addNetworkCustomer(CloudNetwork cloudNetwork);
    int updateNetworkCustomer(CloudNetwork cloudNetwork);
    int deleteNetworkCustomer(Integer id);
    //区县下拉列表
    List<CloudNetwork> selectDistrictName(@Param("cityCode") String cityCode);
    // 查询每个地市的总数
    List<Map<String, Object>> countByCityCode();
    // 查询每个地市下每个客户类型的数量
    List<Map<String, Object>> countByCityCodeAndCustomerType();
    // 查询每个地市下每个区县的总数
    List<Map<String, Object>> countByCityCodeAndDistrict();
    // 查询每个地市下每个区县每个客户类型的数量
    List<Map<String, Object>> countByCityCodeAndDistrictAndCustomerType();

//政务外网商机清单增删改查
    int addNetworkShangJi(CloudNetwork cloudNetwork);
    int updateNetworkShangJi(CloudNetwork cloudNetwork);
    int deleteNetworkShangJi(Integer id);

    List<CloudNetwork> selectByCityCodeAndProviderType(
            @Param("cityCode") String cityCode,
            @Param("providerType") String providerType,
            @Param("districtName") String districtName,
            @Param("filterByContractEndTime") Boolean filterByContractEndTime);
    List<Map<String, Object>> countShangJiByCityCode();
    // 查询每个地市下每个客户类型的数量
    List<Map<String, Object>> countByFourLevelClassify(@Param("filterByContractEndTime") Boolean filterByContractEndTime,@Param("providerType") String providerType);

//政务云客户清单增删改查
    int addCloudCustomerType(CloudNetwork cloudNetwork);
    int updateCloudCustomerType(CloudNetwork cloudNetwork);
    int deleteCloudCustomerType(Integer id);
    List<CloudNetwork> selectCloudCustomerType(@Param("cityCode") String cityCode,@Param("customerType") String customerType,@Param("providerType") String providerType);
    List<Map<String, Object>> countByCustomerType();

//政务云商机清单的增删改查
    int addCloudComplete(CloudNetwork cloudNetwork);
    int updateCloudComplete(CloudNetwork cloudNetwork);
    int deleteCloudComplete(Integer id);
    List<CloudNetwork> selectCloudComplete(@Param("cityCode") String cityCode,@Param("providerType") String providerType,@Param("filterByContractEndTime") Boolean filterByContractEndTime);
    List<Map<String, Object>> countCloudCompleteByCityCode();
    List<Map<String, Object>> countCloudCompleteByContractEndTime(@Param("cityCode") String cityCode,@Param("providerType") String providerType,@Param("filterByContractEndTime") Boolean filterByContractEndTime);

}
